<nav class="navbar navbar-dark jh-navbar">
    <div class="jh-logo-container float-xs-left">
        <a class="jh-navbar-toggler hidden-lg-up float-xs-left" href="javascript:void(0);" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation" (click)="toggleNavbar()">
            <i class="fa fa-bars"></i>
        </a>
        <a class="navbar-brand logo float-xs-right" routerLink="/" (click)="collapseNavbar()">
            <span class="logo-img"></span>
            <span jhiTranslate="global.title" class="navbar-title"><%= capitalizedBaseName %></span> <span class="navbar-version">{{version}}</span>
        </a>
    </div>
    <div class="collapse navbar-toggleable-md float-lg-right" id="navbarResponsive" [ngbCollapse]="isNavbarCollapsed" [ngSwitch]="isAuthenticated()">
        <ul class="nav navbar-nav float-lg-right">
            <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
                <a class="nav-link" routerLink="/" (click)="collapseNavbar()">
                    <i class="fa fa-home" aria-hidden="true"></i>
                    <span class="hidden-sm-down" jhiTranslate="global.menu.home">Home</span>
                </a>
            </li>
            <!-- jhipster-needle-add-element-to-menu - JHipster will add new menu items here -->
            <li *ngSwitchCase="true" ngbDropdown class="nav-item dropdown pointer">
                <a class="nav-link dropdown-toggle" routerLinkActive="active" ngbDropdownToggle href="javascript:void(0);" id="entity-menu">
                    <span>
                        <i class="fa fa-th-list" aria-hidden="true"></i>
                        <span class="hidden-sm-down" jhiTranslate="global.menu.entities.main">
                            Entities
                        </span>
                        <b class="caret"></b>
                    </span>
                </a>
                <ul class="dropdown-menu" ngbDropdownMenu>
                    <!-- jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here -->
                </ul>
            </li>
            <li *ngSwitchCase="true" <%=jhiPrefix%>HasAuthority="ROLE_ADMIN" ngbDropdown class="nav-item dropdown pointer">
                <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
                    <span>
                        <i class="fa fa-user-plus" aria-hidden="true"></i>
                        <span class="hidden-sm-down" jhiTranslate="global.menu.admin.main">Administration</span>
                        <b class="caret"></b>
                    </span>
                </a>
                <ul class="dropdown-menu" ngbDropdownMenu>
                    <%_ if (applicationType == 'gateway') { _%>
                    <li>
                        <a class="dropdown-item" routerLink="gateway" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-road" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.gateway">Gateway</span>
                        </a>
                    </li>
                    <%_ } _%>
                    <li>
                        <a class="dropdown-item" routerLink="user-management" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-user" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.userManagement">User management</span>
                        </a>
                    </li>
                    <%_ if (websocket == 'spring-websocket') { _%>
                    <li>
                        <a class="dropdown-item" routerLink="<%=jhiPrefix%>-tracker" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-eye" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.tracker">User tracker</span>
                        </a>
                    </li>
                    <%_ } _%>
                    <li>
                        <a class="dropdown-item" routerLink="<%=jhiPrefix%>-metrics" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-tachometer" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.metrics">Metrics</span>
                        </a>
                    </li>
                    <li>
                        <a class="dropdown-item" routerLink="<%=jhiPrefix%>-health" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-heart" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.health">Health</span>
                        </a>
                    </li>
                    <li>
                        <a class="dropdown-item" routerLink="<%=jhiPrefix%>-configuration" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-list" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.configuration">Configuration</span>
                        </a>
                    </li>
                    <li>
                        <a class="dropdown-item" routerLink="audits" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-bell" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.audits">Audits</span>
                        </a>
                    </li>
                    <li>
                        <a class="dropdown-item" routerLink="logs" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-tasks" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.logs">Logs</span>
                        </a>
                    </li>
                    <li *ngIf="swaggerEnabled">
                        <a class="dropdown-item" routerLink="docs" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-book" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.apidocs">API</span>
                        </a>
                    </li>
                    <!-- jhipster-needle-add-element-to-admin-menu - JHipster will add entities to the admin menu here -->
                    <%_ if (devDatabaseType == 'h2Disk' || devDatabaseType == 'h2Memory') { _%>
                    <li *ngIf="!inProduction">
                        <a class="dropdown-item" href='/h2-console' target="_tab" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-hdd-o" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.admin.database">Database</span>
                        </a>
                    </li>
                    <%_ } _%>
                </ul>
            </li>
            <%_ if (enableTranslation) { _%>
            <li ngbDropdown class="nav-item dropdown pointer" *ngIf="languages">
                <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="languagesnavBarDropdown" *ngIf="languages.length > 1">
                    <span>
                        <i class="fa fa-flag" aria-hidden="true"></i>
                        <span class="hidden-sm-down" jhiTranslate="global.menu.language">Language</span>
                        <b class="caret"></b>
                    </span>
                </a>
                <ul class="dropdown-menu" ngbDropdownMenu *ngIf="languages.length > 1">
                    <li *ngFor="let language of languages">
                        <a class="dropdown-item" [<%=jhiPrefix%>ActiveMenu]="language" href="javascript:void(0);" (click)="changeLanguage(language);collapseNavbar();">{{language | findLanguageFromKey}}</a>
                    </li>
                </ul>
            </li>
            <%_ } _%>
            <li ngbDropdown class="nav-item dropdown pointer">
                <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="account-menu">
                  <span *ngIf="!getImageUrl()">
                    <i class="fa fa-user" aria-hidden="true"></i>
                    <span class="hidden-sm" jhiTranslate="global.menu.account.main">
                      Account
                    </span>
                    <b class="caret"></b>
                  </span>
                  <span *ngIf="getImageUrl()">
                      <img [src]="getImageUrl()" class="profile-image img-circle" alt="Avatar">
                  </span>
                </a>
                <ul class="dropdown-menu dropdown-menu-right" ngbDropdownMenu>
                    <li *ngSwitchCase="true">
                        <a class="dropdown-item" routerLink="settings" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-wrench" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.settings">Settings</span>
                        </a>
                    </li>
                    <li *ngSwitchCase="true">
                        <a class="dropdown-item" routerLink="password" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-clock-o" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.password">Password</span>
                        </a>
                    </li>
                    <%_ if (authenticationType == 'session') { _%>
                    <li *ngSwitchCase="true">
                        <a class="dropdown-item" routerLink="sessions" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-cloud" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.sessions">Sessions</span>
                        </a>
                    </li>
                    <%_ } _%>
                    <li *ngSwitchCase="true">
                        <a class="dropdown-item" (click)="logout()" id="logout">
                            <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.logout">Sign out</span>
                        </a>
                    </li>
                    <li *ngSwitchCase="false">
                        <a class="dropdown-item" (click)="login()" id="login">
                            <i class="fa fa-fw fa-sign-in" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.login">Sign in</span>
                        </a>
                    </li>
                    <li *ngSwitchCase="false">
                        <a class="dropdown-item" routerLink="register" routerLinkActive="active" (click)="collapseNavbar()">
                            <i class="fa fa-fw fa-registered" aria-hidden="true"></i>
                            <span jhiTranslate="global.menu.account.register">Register</span>
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</nav>
